package org.erp.store.service.impl;

import lombok.extern.slf4j.Slf4j;
import org.erp.store.domain.dto.DeviceRemarkDto;
import org.erp.store.domain.entity.DeviceRemark;
import org.erp.store.infrastructure.convert.DeviceRemarkConvert;
import org.erp.store.service.DeviceRemarkLogicService;
import org.erp.store.service.DeviceRemarkService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Slf4j
@Service
public class DeviceRemarkLogicServiceImpl implements DeviceRemarkLogicService {

    @Resource
    private DeviceRemarkService deviceRemarkService;
    @Resource
    private DeviceRemarkConvert deviceRemarkConvert;

    @Override
    public boolean addDeviceRemark(DeviceRemarkDto deviceRemarkDto) {
       DeviceRemark deviceRemark =deviceRemarkConvert.toDeviceRemark(deviceRemarkDto);
        return deviceRemarkService.save(deviceRemark);

    }

    @Override
    public boolean updDeviceRemark(DeviceRemarkDto deviceRemarkDto) {
        DeviceRemark deviceRemark=deviceRemarkConvert.toDeviceRemark(deviceRemarkDto);
        return deviceRemarkService.updateById(deviceRemark) ;
    }
}
